<template>
	<view style="flex: 1;display: flex;flex-direction: column;">
		<base_navbar>
			<image src="/static/back.png" style="width: 30px;height: 30px;" mode=""></image>
		</base_navbar>
		<view style="flex:1;display: flex;flex-direction: column;
			padding-left: 12px;padding-right: 12px;">
			<!-- 标题 -->
			<view
				style="display: flex;justify-content: space-between;align-items: center;padding-top: 12px;padding-bottom: 12px;">
				<text style="font-size: 32px;">岗位管理</text>
				<image @click="addHandle" src="/static/add.png" style="width: 30px;height: 30px;" mode=""></image>
			</view>
			<view style="flex: 1;background-color: #f5f5f5;overflow-y: auto;height: 0;">
				<view style="display: flex;flex-wrap: wrap;flex-direction: row;">
					<!-- item -->
					<view style="position: relative;
						margin-right: 12px;
						padding-right: 6px;
						margin-top: 12px;
						"
						v-for="(obj,idx) in list"
						:key="idx"
						>
						<!-- 删除按钮 -->
						<view style="background-color: red;position: absolute;right: 0;border-radius: 10px;width: 16px;height: 16px;
							display: flex;
							justify-content: center;
							align-items: center;
							">
							<image src="/static/del.png" style="width: 12px;height: 12px;" />
						</view>
						
						<view style="background-color: #ffffff;
							margin-top: 6px;
							padding: 6px 12px;
							box-shadow: 1px 3px 10px #ebebeb;
							border-radius: 4px;
						">
							<text style="font-size: 14px;">{{obj}}</text>
						</view>
					</view>
				</view>
		
			</view>
			<!-- 添加 -->
			<add_pop v-if="show_add_pop" @closeHandle="show_add_pop=false;" @createHandle="createHandle"
				v-model="name" />
		</view>
	</view>
</template>

<script>
	import add_pop from "./add_pop.vue"

	export default {
		components: {
			add_pop
		},
		data() {
			return {
				show_add_pop:false,
				name:'',
				list:[
					"申人俊",
					"曲傻姑",
					"轩辕氏",
					"文成公主",
					"单伯山",
					"曲洋",
					"察合台",
					"天松道人",
					"黄蓉",
					"祁六三",
					"简管家",
					"吴天德",
					"谭迪人",
					"刘正风",
				]
			}
		},
		methods: {
			addHandle() {
				this.show_add_pop = true;
			},
			createHandle() {
				this.show_add_pop = false;
				this.list.push(this.name)
				this.name = "";
			},
			groupCellClickHandle() {
				uni.navigateTo({
					url: "./admin_group_sub",
				})
			},
		}
	}
</script>

<style>

</style>